package hms.permissions;

/**
 * Permission enum
 * 
 * Here, permissions are defined, along with their order in the database and 
 * their print-friendly name.
 * @author Ben
 *
 */
public enum Permission {
	// Permissions will appear in order of appearance here
	
	/*
	 * PERMISSION_NAME("User-friendly permission string", Unique_DB_ID),
	 * 
	 * - PERMISSION_NAME should be in form VERB_NOUN if possible
	 * - Place permission where you think it should appear on the User Accounts screen 
	 * - You are free to REARRANGE existing permissions but DO NOT ALTER them
	 * - Unique_DB_ID should be an integer between 0-23 that is not already being used.
	 * 
	 */
	
	CHECK_IN_OUT("Check In and Out",0),
	OFFER_ADDITIONAL_GUEST_SERVICES("Offer Additional Guest Services",1),
	RESERVE_ROOMS("Reserve Rooms",2),
	MANAGE_INVENTORY("Manage Inventory",3),
	REPORT_BUILDER("Build Reports",4),
	ADMINISTER_USERS("User Administration",5),
	CONFIGURE_ROOMS("Configure Rooms", 7),
	MANAGE_EMPLOYEES("Manage HR Records", 8),
	//NEW_PERMISSION("Permission Text",10),
	
	// This goes last
	FULL_ACCESS("Full Access",6);
	

	private Permission(String description, int dbOrder) {
		this.description = description;
		this.dbOrder = dbOrder;
	}
	private final String description;
	private final int dbOrder;

	/* (non-Javadoc)
	 * @see java.lang.Enum#toString()
	 */
	public String toString() {
		return description;
	}

	/**
	 * getDbOrder returns the position that the permission has in the string
	 * that the database stores.
	 * 
	 * @return integer represent index position of Permission in permission
	 *         string
	 */
	public int getDbOrder() {
		return dbOrder;
	}
}
